Close the loader before unreffing it in the error case. (#164915, Crispin
authorMatthias Clasen <mclasen@redhat.com>
Sun, 23 Jan 2005 04:35:09 +0000 (04:35 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 23 Jan 2005 04:35:09 +0000 (04:35 +0000)
2005-01-22  Matthias Clasen  <mclasen@redhat.com>

* gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_type)
(gdk_pixbuf_loader_new_with_mime_type): Close the loader
before unreffing it in the error case.  (#164915, Crispin
Flowerday)

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-loader.c

index db00ecc44b54794a41f680c232bc1ec623c4fd01..aba98985454e6383b08aaf939b85b070d57bfcd7 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-22  Matthias Clasen  <mclasen@redhat.com>
+
+       * gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_type) 
+       (gdk_pixbuf_loader_new_with_mime_type): Close the loader
+       before unreffing it in the error case.  (#164915, Crispin 
+       Flowerday)
+
 2005-01-12  Owen Taylor <otaylor@redhat.com>
 
        * Makefile.am:  Use grep | head -n 1 instead of grep -m 1 
index 9e252c5706213b99fe9bf72370475d7aaa7b00f2..bccee9fc778d34bb588f2a68eacb77d5fa2411ed 100644 (file)
@@ -564,6 +564,7 @@ gdk_pixbuf_loader_new_with_type (const char *image_type,
         if (tmp != NULL)
                 {
                         g_propagate_error (error, tmp);
+                        gdk_pixbuf_loader_close (retval, NULL);
                         g_object_unref (retval);
                         return NULL;
                 }
@@ -619,10 +620,11 @@ gdk_pixbuf_loader_new_with_mime_type (const char *mime_type,
         retval = g_object_new (GDK_TYPE_PIXBUF_LOADER, NULL);
 
         tmp = NULL;
-        gdk_pixbuf_loader_load_module(retval, image_type, &tmp);
+        gdk_pixbuf_loader_load_module (retval, image_type, &tmp);
         if (tmp != NULL)
                 {
                         g_propagate_error (error, tmp);
+                        gdk_pixbuf_loader_close (retval, NULL);
                         g_object_unref (retval);
                         return NULL;
                 }